package com.yjd.comm.enums;

/**
 * 信用风险评级
 * Created by yangchangyan on 2017/8/25.
 */
public enum CreditIndustryLevel {

    EXCELLENT("0", "无逾期记录"),
    GOOD("1", "有一周以内的轻微逾期记录"),
    AVERAGE("2", "有一周以上中等逾期记录"),
    FAIR("3", "有一个月以上的严重逾期记录"),
    NOTFOUND("N/A", "无法评估该用户逾期状况")
    ;

    private String code;
    private String label;

    public static CreditIndustryLevel parse(String code) {
        for (CreditIndustryLevel v : CreditIndustryLevel.values()) {
            if (v.getCode().equals(code) ) {
                return v;
            }
        }
        return null;
    }

    private CreditIndustryLevel(String code, String label) {
        this.code = code;
        this.label = label;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }
}
